package com.ml.mall.entity.order;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_order")
@ApiModel(value = "sys_order对象", description = "")
public class SysOrder implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_at", fill = FieldFill.INSERT)
    private Date createAt;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_at", fill = FieldFill.INSERT_UPDATE)
    private Date updateAt;

    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除")
    @TableField(value = "is_delete",fill = FieldFill.INSERT)
    @TableLogic(value = "0",delval = "1")
    private Integer isDelete;

    /**
     * 采购订单号
     */
    @TableField(value = "oid")
    private Long oid;

    /**
     * 商品总额
     */
    @TableField(value = "product_fee")
    private BigDecimal productFee;

    /**
     * 运费
     */
    @TableField(value = "delivery_fee")
    private BigDecimal deliveryFee;

    /**
     * 收费调整：系统提成
     */
    @TableField(value = "adapt_fee")
    private BigDecimal adaptFee;

    /**
     * 税费调整
     */
    @TableField(value = "tax_fee")
    private BigDecimal taxFee;

    /**
     * 订单总额
     */
    @TableField(value = "sub_fee")
    private BigDecimal subFee;

    /**
     * 真实支付
     */
    @TableField(value = "true_pay")
    private BigDecimal truePay;

    /**
     * 发票号
     */
    @TableField(value = "invoice_id")
    private String invoiceId;

    /**
     * 支付信息ID
     */
    @TableField(value = "pay_id")
    private Long payId;

    /**
     * -1:Reject；0:pending；1:payment；2：paid；3：processing；4：delivered；5：complete
     */
    @TableField(value = "state")
    private Integer state;

    /**
     * 采购公司ID
     */
    @TableField(value = "company_id")
    private Long companyId;

    /**
     * 名称避免连表查询：此处写
     */
    @TableField(value = "company_name")
    private String companyName;

    /**
     * 商品数量
     */
    @TableField(value = "all_quantity")
    private Integer allQuantity;

    /**
     * 完成时间
     */
    @TableField(value = "completion_date")
    private Date completionDate;
    //新增关于优惠券的信息
    @TableField(value = "have_coupon")
    private Integer haveCoupon;

    @TableField(value = "coupon_money")
    private BigDecimal couponMoney;

    @TableField(value = "credit_money")
    private BigDecimal creditMoney;

    @TableField(value = "buyer_acc")
    private String buyerAcc;

    private static final long serialVersionUID = 1L;
}